#!/bin/sh

doc=$1
viewer=acroread

if [ -n "$doc" ] ; then
 	pid=`ps ax | grep "${viewer} ${doc}"  | grep -v grep | awk '{print $1}'`
 	if [ -n "$pid" ] ; then
 		echo "try to stop $viewer with pid $pid"
 		kill $pid
 	else
 		echo "no viewer $viewer running"
 	fi
else
	echo "no document specified"
fi